# back2WeixinLogin.coffee
#
# @description :: TODO: You might write a short summary of how this model works and what it represents here.
# @docs        ::

module.exports = (statusCode) ->

  # Get access to `req` and `res`
  # (since the arguments are up to us)
  req = this.req;
  res = this.res;

  sails.log.debug '必须使用微信登录才能访问!'

  # All done- either send back an empty response w/ just the status code
  # (e.g. for AJAX requests)
  if req.wantsJSON
    return res.send(statusCode||200);

  # or redirect to the home page
  return res.redirect('/needAuthByWx');
